package tasks.io.client;

import tasks.io.core.Node;

import java.nio.channels.AsynchronousSocketChannel;
import java.util.concurrent.CountDownLatch;


/**
 * @author huihui
 */
public class ConnectionCompletionHandlerVo {

    private Client client = null;
    private final String bindIp;
    private final Integer bindPort;
    private final Node serverNode;
    private AsynchronousSocketChannel asynchronousSocketChannel;
    private ClientChannelContext clientChannelContext = null;
    //
    private boolean isReconnect = false;


    private CountDownLatch countDownLatch = null;


    public ConnectionCompletionHandlerVo(Client client, String bindIp, Integer bindPort, Node serverNode,
                                         //
                                         AsynchronousSocketChannel asynchronousSocketChannel, ClientChannelContext clientChannelContext,
                                         //
                                         boolean isReconnect) {
        super();

        this.client = client;
        this.bindIp = bindIp;
        this.bindPort = bindPort;
        this.serverNode = serverNode;
        this.asynchronousSocketChannel = asynchronousSocketChannel;
        this.clientChannelContext = clientChannelContext;
        //
        this.isReconnect = isReconnect;


    }


    public Client getTioClient() {
        return client;
    }


    public AsynchronousSocketChannel getAsynchronousSocketChannel() {
        return asynchronousSocketChannel;
    }


    public String getBindIp() {
        return bindIp;
    }

    public Integer getBindPort() {
        return bindPort;
    }

    public ClientChannelContext getClientChannelContext() {
        return clientChannelContext;
    }


    public java.util.concurrent.CountDownLatch getCountDownLatch() {
        return countDownLatch;
    }


    public Node getServerNode() {
        return serverNode;
    }


    public boolean isReconnect() {
        return isReconnect;
    }


    public void setAsynchronousSocketChannel(AsynchronousSocketChannel asynchronousSocketChannel) {
        this.asynchronousSocketChannel = asynchronousSocketChannel;
    }


    public void setClientChannelContext(ClientChannelContext clientChannelContext) {
        this.clientChannelContext = clientChannelContext;
    }


    public void setCountDownLatch(java.util.concurrent.CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }


}
